import request from "../utils/request"

/**
 * 根据用户编号获取用户信息
 * @param id 用户编号
 * @returns 
 */
export const getUserById = function (id: string) {
  return request.get(`/user/info/${id}`)
}

/**
 * 获取用户详情
 * @param id 
 * @returns 
 */
export const getUserDetail = function (id: string) {
  return request.get(`/user/detail/${id}`)
}

/**
 * 保存用户信息
 * @param user 
 * @returns 
 */
export const saveUser = function (user: any) {
  return request.post(`/user/save`, user)
}

// 测试时间
export const dateTest = function (d: any) {
  return request.post('/user/test', d)
}

/**
 * 修改密码
 * @param pwdForm 
 * @returns 
 */
export const changePwd = function (pwdForm: any) {
  return request.post('/user/changPwd', pwdForm)
}

/**
 * 根据编号删除用户
 * @param id 
 */
export const deleteUserById = function (id: string) {
  return request.delete(`/user/delete/${id}`)
}

/**
 * 重置用户密码
 * @param id 
 */
export const resetPwd = function (id: string) {
  return request.post(`/user/pwd/reset/${id}`)
}